#!/bin/sh

if [ `uname` = "HP-UX" ]
then
	# If the required link in run level three does not exist
	# then add it...

	if [ -a /sbin/rc3.d/S900tp2 ]
	then
		rm -f /sbin/rc3.d/S900tp2
		cd /sbin/rc3.d
		rm -f S900tp2
		cd /sbin/rc2.d
		rm -f S900tp2
		cd /sbin/rc1.d
		rm -f S900tp2
	fi

	if [ ! -a /etc/rc.config.d/tp2 ]
	then
		cd /etc/rc.config.d
		rm -f tp2 tp2.example tp2.rc tp2.rc.example
	fi
fi

# If the daemon is running then stop it now... #

x=`ps -ef | egrep "perl.*-w.*/tp2daemon" | grep -v grep | awk '{print $2}'`
[ -n "$x" ] && kill $x

exit 0
